Repository navigation
fix(studio): a sealed resize of a layer whose GSAP keyframes animate its width saves - #8288
Conversation
Edit accuracy: accurate 271 (base branch 271), smooth 84 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
eddy-heygen
left a comment
There was a problem hiding this comment.
(Eddy's agent) Reviewed by Eddy's Claude agent at commit 7df1f70 (full diff read by me).
Verdict: approve.
Summary
In a sealed preview, resizing a layer whose keyframes animate only its width (or only its height) was dropped: the layer's size before the gesture was read off Studio's stand-in element, which carries none. The one helper that reads the pre-gesture size now falls back to the box the frame measured when the gesture started, and the three places that needed that size all use it.
What I checked
- For a live (unsealed) element the recorded original size is still used first, so that path is unchanged.
- The fallback is used per side and only when the recorded value is missing; a zero or absent measured side is not written, so the old defaults still apply in the intercept.
- The duplicated fallback that existed in one of the three places is replaced by the shared helper with the same order of preference.
- No port request is added; the measured box is the one the gesture already had.
CI: 54 pass, 20 skipped, none failing; 2 pending (the runtime tests and the producer integration tests, which do not cover the changed Studio file). The Studio tests and edit-accuracy shards passed.
What
In a sealed preview (Studio cannot script the frame), resizing a layer whose GSAP keyframes animate its width now saves. Before, the resize was refused ("Studio can't add this edit to the animation's keyframes") and the box snapped back to its old size when released. An unsealed preview already saved it.
The sealed preview is off by default until the sealed-by-default change (#7846) lands, so nothing changes for anyone before then.
Why
A resize written into a size tween fills in the side the tween does not animate (here the height) at the tween's existing keyframes, from the box as it was before the drag. Studio reads that box from marks the resize draft leaves on the element. In a sealed preview the draft runs on the frame's element, so the selection's stand-in has no marks: the height had no value, and the keyframe edit refused itself (
implicit-end-unknown).A sealed press already measures the box in the frame (
gesture-start's layout,gestureStartLayout), and the scale route of the same resize already falls back to it.How
preGestureBoxSizeis the one read of the box before the draft, for the size tween's backfill, the size route's backfill and the scale route's base size: the draft's marks first, then, for a sealed stand-in, the box its press measured. The scale route's own copy of that fallback goes.A resize with no press (an agent's or a typed one) on a sealed layer still has no measured box unless an earlier press measured it; that is unchanged here.
Test plan
gsapResizeIntercept.test.ts, a size written at the playhead into a tween that animates only width:fails without the fix:
blocked, notpersisted).Run on Linux: the resize intercept tests pass three runs in a row; Studio's
hooks,components/editorandwebmcptests (4048) pass; Studiotscno errors; format clean.Bench
Edit-accuracy bench, resize drags of layers GSAP animates (
fromto,keys,scale,size) at r0, root, 100% zoom (12 per run), at main and at this change:smoothonly)Sealed
keysresizes go from never saved (60 px drop, the box back at its old size) to accurate, 3 of 3. The three left are sealedscaleresizes, unchanged and fixed separately: there the scale route's last step, which moves the scaled box onto the drop point, needs the frame's element.smooth(frame pacing) is reported and not gated; every geometry check in those two unsealed cases passes.Before
Sealed preview at main, the bench's
keyslayer (GSAP keyframes animate its x and width) at 1 s, after a corner drag that grew it: the resize is refused and the box is back at its old size.After
The same drag at this change: the box keeps the size it was dropped at, and the size and position keys at 1 s are in the tween.